package com.powergame.main;

import com.jme3.app.SimpleApplication;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box;
import com.jme3.texture.Texture;

/**
 * test
 * @author normenhansen
 */
public class PowerGameMain extends SimpleApplication {

    public static void main(String[] args) {
        PowerGameMain app = new PowerGameMain();
        app.start();
    }
    
    public void setUpPlateau(){
        Geometry scene = new Geometry("Plateau", new Box(Vector3f.ZERO, 100f, 1f, 50f));
        //scene.scale(0.05f);
        
        Material mat = new Material(assetManager, "/Common/MatDefs/Light/Lighting.j3md");
        mat.setTexture("DiffuseMap", assetManager.loadTexture("/Models/map.jpg"));
        scene.setMaterial(mat);
        
        rootNode.attachChild(scene);
        
        System.out.println(scene.getLocalTranslation());
     }
    
    public void setUpLights(){
        DirectionalLight sun = new DirectionalLight();
        sun.setDirection((new Vector3f(0.5f, -0.5f, 0)).normalize());
        sun.setColor(ColorRGBA.White);

        rootNode.addLight(sun);
    }
    
    public void setUpCamera(){
        cam.setLocation(new Vector3f(5f, 2f, 5f));
    }

    @Override
    public void simpleInitApp() {
       setUpLights();
       setUpPlateau();
       setUpCamera();
    }

    @Override
    public void simpleUpdate(float tpf) {
    }

    @Override
    public void simpleRender(RenderManager rm) {
    }
}
